let that;
terminalwork = new Vue({
	el: "#terminalwork",
	data: {
		isShowList: false,
		userInfo: '', // 用户信息

		stationList: [], // 电站列表

		searchType: 'todo', // 列表展示类型
		terminalKeyword: '', // 关键字
		currentPage: 1, // 当前页
		terminalworkList: [], // 定期工作列表
		isSelectDay: '', // 是否是本月最后一天
		DELAY_DAY: [], // 延期码表
		protectList: [], // 蓄电池码表


		selectRow: {}, // 操作行数据
		isShowOperBtn: false, // 是否显示操作按钮
		isShowTerminalDelay: false, // 是否显示延期
		isShowTerminalTransfer: false, // 是否显示转办
		isSingle: true, // 转办人员组建是否单选
		isShowTerminalReceive: false, // 是否显示领取
		role:'',//用户身份
		isShowAppoint: false, // 是否显示指派
		appointPersin: false, // 选择指派人(多选)
		persionMorName:"",//多选人 记录
		persionMorId:"",//多选人 id 记录
	},
	components: {
		personselect,
		multipleselect
	},
	mounted: function() {
		that = this;
		// 获取用户信息
		this.userInfo = JSON.parse(localStorage.getItem('neiosUser'))
		localStorage.setItem("todoWork", '')
		let roles = this.userInfo.roles
		  if(roles.indexOf('NEIOS_AREA_COMPANY')>=0){
		   this.role = 'company'
		  }
		  else if(roles.indexOf('NEIOS_STATION')>=0){
		   this.role = 'station'
		  }
		  else{
		   this.role = 'total'
		  }
		let _this = this
		// 获取人员信息
		let userInfo = JSON.parse(localStorage.getItem('neiosUser'))
		console.log("工作台人员信息:"+JSON.stringify(that.userInfo))
		if (userInfo.roles.indexOf('NEIOS_STATION') > -1) {
			$('.neios-station-name').text(localStorage.getItem('neiosStationName'))
			if (userInfo.stationNewCodes.length > 1) {
				$('.neios-station-btn').show()
				for (let a = 0; a < userInfo.stationNewCodes.length; a++) {
					let item = {
						name: userInfo.stationNewNames[a],
						code: userInfo.stationNewCodes[a]
					}
					_this.stationList.push(item)
				}
			}
		}
		// 获取列表
		setTimeout(function() {
			that.queryTerminalList(_this.currentPage);
		}, 600);
		
		// 判断当前日期是否是当月最后一天
		let dayth = new Date().getDate();
		let realYear = new Date().getFullYear();
		let myMonth = new Date().getMonth() + 1;
		let d = new Date(realYear, myMonth, 0);
		let monthDays = d.getDate(); // 本月有几天
		this.isSelectDay = monthDays - dayth;
		// 获取延期码表、保护用蓄电池码表、通信蓄电池码表
		let dictCodes = 'DELAY_DAY,STORBATTARY_GROUP_TYPE';
		let dict = mui.neiosCommon.queryDict(dictCodes, function(data) {
			if (data != '') {
				_this.DELAY_DAY = data.DELAY_DAY
				_this.protectList = data.STORBATTARY_GROUP_TYPE
			}
		})
	},
	methods: {
		// 切换场站
		changeStation(item) {
			let userInfo = JSON.parse(localStorage.getItem('neiosUser'))
			userInfo.stationNewName = item.name
			userInfo.stationNewCode = item.code
			this.userInfo = userInfo
			localStorage.setItem('neiosUser',JSON.stringify(userInfo))
			$('.neios-station-dialog-box').hide()
			localStorage.setItem('neiosStationName', item.name)
			localStorage.setItem('neiosStationCode', item.code)
			$('.neios-station-name').text(item.name)
			this.currentPage = 1
			this.queryTerminalList(1)
		},
		// 隐藏操作按钮
		hideOperBtn() {
			$('.todo').css('width', '0');
			$('.toAppoint').css('width', '0');
		},
		// 查询列表
		queryTerminalList(current) {
			
			this.hideOperBtn()
			let url = ''
			if (this.searchType == 'todo') {
				url = '/app/personWork/loadBackLog'
			} else {
				url = '/app/personWork/loadWaitDraw'
			}
			let _this = this
			let param = {
				searchType: 0,
				current: current,
				pageSize: 10,
				currentUser: this.userInfo,
				areaCompanyCode: this.role == 'station'? '' : this.userInfo.companyNewCode,
				stationCode: this.userInfo.stationNewCode,
				role: that.userInfo.roles,
				roles:that.userInfo.roles,
				userId: this.userInfo["userId"],
				keyWord: this.terminalKeyword,
				workEndDateStart: "",
				workEndDateEnd: "",
				nodeCreateTimeStart: "",
				nodeCreateTimeEnd: "",
				createDateStart: "",
				createDateEnd: ""
			}
			console.log("URL:"+url+"参数："+JSON.stringify(param))
			
			mui.neiosRequst.httpRequst(url, param,
				function(data) {
					if (data.code == '0') {
						_this.isShowList = true
						if (_this.currentPage == 1) {
							mui('#terminalworkList').pullRefresh().enablePullupToRefresh();
							mui('#terminalworkList').pullRefresh().endPullupToRefresh();
							_this.terminalworkList = data.data.records;
							console.log("待办返回值参数======"+_this.currentPage,data.data);
						} else {
							mui('#terminalworkList').pullRefresh().endPullupToRefresh();
							_this.terminalworkList = _this.terminalworkList.concat(data.data.records);
							console.log("待办返回值参数======"+_this.currentPage,data.data);
						}
						if (data.data.current >= data.data.pages) {
							console.log("====================禁用====================")
							mui('#terminalworkList').pullRefresh().disablePullupToRefresh();
							mui('#terminalworkList').pullRefresh().endPullupToRefresh(true);
						}
						console.log('列表页面数据：'+ JSON.stringify(_this.terminalworkList))
					} else {
						_this.terminalworkList = []
						mui.toast('查询列表失败，请稍后重试！')
					}
				},
				function() {
					_this.terminalworkList = []
					mui.toast('查询列表失败，请稍后重试！')
				}
			);
		},
		// 切换类型
		changeSearchType(type) {
			this.searchType = type
			this.currentPage = 1
			// 接下来执行查询方法
			this.queryTerminalList(1)
			this.isShowList = false
		},
		// 关键字搜索
		terminalKeywordChange() {
			this.currentPage = 1
			this.queryTerminalList(1)
			this.isShowList = false
		},
		// 点击延期按钮
		terminalDelay(row) {
			this.hideOperBtn()
			this.isShowTerminalDelay = true
			this.selectRow = row
		},
		// 延期窗口取消
		terminalDelayCacel() {
			this.isShowTerminalDelay = false
			this.selectRow = {}
		},
		// 延期窗口确认
		terminalDelaySure() {
			let _this = this
			let delay = $('input[name="terminalDelay"]')
			let delayArr = []
			let delayDay = ''
			for (let item of delay) {
				if (item.checked) {
					delayArr.push(item.value)
				}
			}
			if (delayArr == 0) {
				mui.toast("请选择延期天数！")
			} else {
				let params = {
					workId: this.selectRow.workId, // 任务主键
					delayDays: delayArr[0], // 延期天数
					nodeDealStaffCode: this.userInfo.userId, // 当前登录人工号
					nodeDealStaffName: this.userInfo.name, // 当前登录人姓名
				}
				let _this = this
				mui.neiosRequst.httpRequst('/app/personWork/dalayWork', params,
					function(data) {
						if (data.code == '0') {
							_this.terminalDelayCacel()
							_this.queryTerminalList('1')
							mui.toast('延期成功！')
						} else {
							mui.toast('请稍后重试！')
						}
					},
					function() {
						mui.toast('请稍后重试！')
					}
				);
			}
		},
		// 点击转办按钮
		terminalTransfer(row) {
			this.hideOperBtn()
			this.isShowTerminalTransfer = true
			this.selectRow = row
		},
		// 转办窗口取消
		terminalTransferCacel() {
			this.isShowTerminalTransfer = false
			this.selectRow = {}
		},
		// 转办窗口确认
		terminalTransferSure() {
			let _this = this
			if (this.$refs.transferPerson.person == '') {
				mui.toast("请选择人员！")
			} else {
				let person = this.$refs.transferPerson.person
				let params = {
					workId: this.selectRow.workId, // 任务主键
					nodeCreateStaffCode: this.userInfo.userId, // 当前登录人工号
					nodeCreateStaffName: this.userInfo.name, // 当前登录人姓名
					dataSource: 'NEIOS_APP'+localStorage.getItem("currVersion"), // 固定值
					nodeDealStaffName: person.substring(person.indexOf("]") + 1), // 转办人姓名
					nodeDealStaffCode: this.$refs.transferPerson.personids, // 转办人工号
				}
				if(this.$refs.transferPerson.personids == this.userInfo.userId){
					mui.toast("不能转办给自己，请重新选择转办人！")
					return;
				}
				
				let _this = this
				mui.neiosRequst.httpRequst('/app/personWork/sendTransfer', params,
					function(data) {
						if (data.code == '0') {
							_this.terminalTransferCacel()
							_this.queryTerminalList('1')
							mui.toast('转办成功！')
						} else {
							mui.toast('请稍后重试！')
						}
					},
					function() {
						mui.toast('请稍后重试！')
					}
				);
			}
		},
		// 点击领取按钮
		showReceiveBtn(row) {

			this.hideOperBtn()
			this.selectRow = row
			let _this = this
			if (row.workType == '0101' || row.workType == '0111' ||
				row.workType == '0112' || row.workType == '0114' ||
				row.workType == '0116' || row.workType == '0117') {
				this.isShowTerminalReceive = true
			} else {
				var btnArray = ['取消', '确定'];
				mui.confirm('是否确认领取？', '提示', btnArray, function(e) {
					if (e.index == 1) {
						let rowData = JSON.parse(JSON.stringify(row))
						rowData.nodeCreateStaffCode = _this.userInfo.userId
						rowData.nodeCreateStaffName = _this.userInfo.name
						let param = {
							neiosWorkVO: rowData,
							currentUser: _this.userInfo,
							
						}
						_this.terminalReceive(param)
					} else {
						_this.terminalReceiveCacel()
					}
				})
			}
		},
		// 领取窗口取消
		terminalReceiveCacel() {
			this.isShowTerminalReceive = false
			this.selectRow = {}
		},
		// 领取窗口确认
		terminalReceiveSure() {
			let _this = this
			let nodeDealStaffRoleList = [] // 监护人、搭档检查人
			let groupList = [] // 蓄电池
			if (this.selectRow.workType == '0101' ||
				this.selectRow.workType == '0112' ||
				this.selectRow.workType == '0114' ||
				this.selectRow.workType == '0116' ||
				this.selectRow.workType == '0117' ) {
					
					if(null != this.$refs.personselectRecieve){
						if (this.$refs.personselectRecieve.personids == '') {
							mui.toast('请选择监护人！')
							return
						} else if (this.$refs.personselectRecieve.personids.toUpperCase() == this.userInfo.userId.toUpperCase()) {
							mui.toast('监护人不能为本人')
							return
						}else {
							let person = this.$refs.personselectRecieve.person
							let item = {
								nodeDealStaffCode: this.$refs.personselectRecieve.personids,
								nodeDealStaffName: person.substring(person.indexOf("]") + 1)
							}
							nodeDealStaffRoleList.push(item)
						}
					}
				
			} else if (this.selectRow.workType == '0111') {
				if ( _this.$refs.personselectRecieveSec.personids == '') {
					mui.toast('请选择搭档检查人！')
					return
				}else if( this.$refs.personselectRecieveSec.person ==  _this.userInfo.userName){
					mui.toast('搭档检查人不能为本人！')
					return
				} else {
					let person = this.$refs.personselectRecieveSec.person
					let item = {
						nodeDealStaffCode: this.$refs.personselectRecieveSec.personids,
						nodeDealStaffName: person.substring(person.indexOf("]") + 1)
					}
					nodeDealStaffRoleList.push(item)
				}
			}
			if (this.selectRow.workType == '0101') {
				if (this.$refs.groupProtect.miltipleselected.length == 0 &&
					this.$refs.groupSignal.miltipleselected.length == 0) {
					mui.toast('请至少领取一组蓄电池！')
					return
				} else {
					this.$refs.groupProtect.miltipleselected.forEach(element => {
						groupList.push('1-' + element)
					})
					this.$refs.groupSignal.miltipleselected.forEach(element => {
						groupList.push('2-' + element)
					})
				}
			}
			// 准备接口数据
			let param = {}
			let rowData = JSON.parse(JSON.stringify(this.selectRow))
			rowData.nodeCreateStaffCode = _this.userInfo.userId
			rowData.nodeCreateStaffName = _this.userInfo.name
			param = {
				neiosWorkVO: rowData,
				currentUser: _this.userInfo,
				nodeDealStaffRoleList: nodeDealStaffRoleList,
				groupList: groupList,
			}
			this.terminalReceive(param, '0')
		},
		// 调用领取接口
		terminalReceive(param, type) {
			console.log("======调用领取接口参数1========",JSON.stringify(param));
			console.log("======调用领取接口参数1========",JSON.stringify(param));
			let _this = this
			mui.neiosRequst.httpRequst('/app/personWork/drawTask', param,
				function(data) {
					that.clearPersion()
					if (data.code == '0') {
						if (type == '0') {
							_this.terminalReceiveCacel()
							mui.toast('领取成功！')
						} else {
							_this.appointCacel()
							mui.toast('领取成功！')
						}
						_this.queryTerminalList('1')
					} else {
						mui.toast('请稍后重试！')
					}
				},
				function() {
					that.clearPersion()
					mui.toast('请稍后重试！')
				}
			);
		},
		// 点击指派按钮
		showAppointBtn(row) {
			this.hideOperBtn()
			this.isShowAppoint = true
			this.selectRow = row
			//设置已选择的 人员信息（安全设施用）
			// that.persionMorId += that.$refs.appointMulti.personids+","
			// that.persionMorName += that.$refs.appointMulti.person+",";
			
			
			
		},
		// 指派窗口取消
		appointCacel() {
			this.isShowAppoint = false
			this.selectRow = {}
		},
		//当前已选择的人员回调
		itemChange(){
			let a = that.$refs.appointMulti;
			if(that.$refs.appointMulti != null){
				that.persionMorId += that.$refs.appointMulti.personids+","
				that.persionMorName += that.$refs.appointMulti.person+",";
				this.$nextTick(that.$refs.appointMulti.personids = that.persionMorId)
				this.$nextTick(that.$refs.appointMulti.person = that.persionMorName)
			}
			debugger
			// console.log("选择人："+chooseData)
		},
		//初始化选择人
		initPer(){
			this.$nextTick(that.$refs.appointMulti.personids = that.persionMorId)
			this.$nextTick(that.$refs.appointMulti.person = that.persionMorName)
		},
		clearPersion(){
			that.persionMorId = ""
			that.persionMorName = "";
			if(that.$refs.appointMulti != null){
				this.$nextTick(that.$refs.appointMulti.personids = that.persionMorId)
				this.$nextTick(that.$refs.appointMulti.person = that.persionMorName)
			}

			
		},
		// 指派窗口确认
		appointSure() {
			let _this = this
			let nodeDealStaffRoleList = [] // 监护人、搭档检查人
			let groupList = [] // 蓄电池
			let nodeCreateStaffCode = ''
			let nodeCreateStaffName = ''
			if (this.selectRow.workType == '0111') {
				if (_this.$refs.appointMulti.personids == '') {
					mui.toast('选择指派人！')
					return
				} else {
					if (_this.$refs.appointMulti.personids.split(',').length < 2) {
						mui.toast('至少选择两个指派人！')
						return
					} else {
						nodeCreateStaffCode = _this.$refs.appointMulti.personids
						let personName = _this.$refs.appointMulti.person.split(',')
						for (let personItem of personName) {
							let el = personItem.substring(personItem.indexOf("]") + 1)
							nodeCreateStaffName += el + ','
						}
					}
				}
			} else {
				if (_this.$refs.appointSingle.personids == '') {
					mui.toast('选择指派人！')
					return
				} else {
					nodeCreateStaffCode = _this.$refs.appointSingle.personids
					let person = _this.$refs.appointSingle.person
					nodeCreateStaffName = person.substring(person.indexOf("]") + 1)
				}
				if (this.selectRow.workType == '0101' ||
					this.selectRow.workType == '0112' ||
					this.selectRow.workType == '0114') {
					if (_this.$refs.appointPerson.personids == '') {
						mui.toast('选择监护人！')
						return
					} else {
						let appPerson = this.$refs.personselectRecieveSec.person
						let item = {
							nodeDealStaffCode: this.$refs.personselectRecieveSec.personids,
							nodeDealStaffName: appPerson.substring(appPerson.indexOf("]") + 1)
						}
						nodeDealStaffRoleList.push(item)
					}
				}
			}
			if (this.selectRow.workType == '0101') {
				if (this.$refs.groupProtect.miltipleselected.length == 0 &&
					this.$refs.groupSignal.miltipleselected.length == 0) {
					mui.toast('请至少领取一组蓄电池！')
					return
				} else {
					this.$refs.groupProtect.miltipleselected.forEach(element => {
						groupList.push('1-' + element)
					})
					this.$refs.groupSignal.miltipleselected.forEach(element => {
						groupList.push('2-' + element)
					})
				}
			}
			// 准备接口数据
			let param = {}
			let rowData = JSON.parse(JSON.stringify(this.selectRow))
			rowData.nodeCreateStaffCode = nodeCreateStaffCode
			rowData.nodeCreateStaffName = nodeCreateStaffName
			param = {
				neiosWorkVO: rowData,
				currentUser: _this.userInfo,
				nodeDealStaffRoleList: nodeDealStaffRoleList,
				groupList: groupList,
			}
			this.terminalReceive(param, '1')
		},
		// 办理
		doWork(item) {
			let url = ''
			if (item.workType == '0112') { // 差动电流1
				url = 'diffcurrent/list.html'
			} else if (item.workType == '0115') { // 网络安全2
				url = 'netSafeDevice/list.html'
			} else if (item.workType == '0201') { // 交接班3
				url = '../dailyRecord/shiftsChange/handOver.html'
			} else if ( item.workType == '0202') { // 钥匙归还借用4
				url = '../dailyRecord/keyBorrow/detail.html'
			}else if ( item.workType == '0203') { // 钥匙归还借用4
				url = '../dailyRecord/keyBorrow/returnDetail.html'
			} 
			 else if (item.workType == '0102') { // 场用电定期检查 5
				url = 'powerSystem/powerSystem.html'
			} else if (item.workType == '0103') { // UPS定期检查6
				url = 'UPS/UPS.html'
			} else if (item.workType == '0104') { // 事故照明定期检查7
				url = 'light/light.html'
			} else if (item.workType == '0105') { // 主变风冷定期检查8
				url = 'airCooling/airCooling.html'
			} else if (item.workType == '0106') { // 直流切换定期检查9
				url = 'direct/direct.html'
			} else if (item.workType == '0107') { // 消防切换定期检查10
				url = 'fireControl/fireControl.html'
			} else if (item.workType == '0108') { // 通信定期检查11
				url = 'communication/communication.html'
			} else if (item.workType == '0109') { // 柴油发电机定期检查12
				url = 'dieselGenerator/dieselGenerator.html'
			} else if (item.workType == '0209') { // 涉网设备投退记录13
				url = '../dailyRecord/network/index.html'
			} else if (item.workType == '0206') { // 变压器有载调压14
				// url = '../dailyRecord/transformer/procressing.html'
				this.doIt(item)
				return
			} else if (item.workType == '0208') { // 保护压板投退记录15
				url = '../dailyRecord/platenProtect/index.html'
			} else if (item.workType == '0101') { // 蓄电池16
				url = 'storBattery/storBattery.html'
			} else if (item.workType == '0110' || item.workType == '0207') { // 工器具定期17、工器具日常18
				url = 'toolCheck/toolCheckAdd.html'
			} else if (item.workType == '0302') { // 应急演练
				url = '../education/drillEdit.html'
			} else if (item.workType == '0301') { // 安全活动
				url = '../education/trainEdit.html'
			} else if (item.workType == '0114') { // 设备红外
				url = 'infrared/list.html'
			} else if (item.workType == '0113') { // 生活消防水
				url = 'lifeWater/list.html'
			} else if (item.workType == '0117') { // 避雷器
				url = 'lightningArrester/lightningArrester.html'
			} else if (item.workType == '0111') { // 安全设施
				url = 'safeDevice/list.html'
			} else if (item.workType == '0116') { // 主变铁芯、夹地
				url = 'mainTransCore/mainTransCore.html'
			} else if (item.workType == '0401') { // 风电场巡检
				url = '../control/windFarmCheck/list.html'
			} else if (item.workType == '0402') { // 光伏电站巡检
				url = '../control/photFarmCheck/list.html'
			} else if (item.workType == '0403') { // 集控机房巡视
				url = '../control/computerRoom/computerRoom.html'
			} else if (item.workType == '0404') { // 风电升压站设备巡视
				url = '../control/windpowerStation/windpowerStation.html'
			} else if (item.workType == '0405') { // 光伏升压站设备巡视
				url = '../control/PhotovoltaicboosterStation/PhotovoltaicboosterStation.html'
			}
			let param = {
				obj: item,
				alwinType: 1
			}
			localStorage.setItem("todoWork", JSON.stringify(param))
			mui.openWindow({
				url: url,
				id: url,
				extras: {},
				waiting: {
					autoShow: false
				}
			});
		},
		
		//单据办理--在线状态
		doIt(item){
			console.log("列表数据："+JSON.stringify(item))
			let param = {};
			let workId = item.workId;
			let transOperateId = item.transOperateId;
			param.workId = workId;
			param.transOperateId = transOperateId;
			param.pageType = '3'; //0 录入|新增 1 展示/详情 2编辑修改 3办理,5办理离线
			param.listType = '32';
			param.operateStaffName = item.operateStaffName;
			param.operateStaffCode = item.operateStaffCode;
			param.tutelageStaffCode = item.tutelageStaffCode;
			param.tutelageStaffName = item.tutelageStaffName;
			let config = mui.neioConfig.getNeioConfig(); 
			let pageKey = config.KEYS.PAGE_PARAM;
			mui.neioConfig.setStorage(pageKey,JSON.stringify(param))
			console.log("OOOOO:"+JSON.stringify(param)) 
			url = "../dailyRecord/transformer/procressing.html";
			mui.openWindow({
				url: url,
				id:'procressing.html',
				extras: {},
				waiting: {
					autoShow: false
				}
			});
			// that.gotoPage("procressing.html",param)
		},
		
		//获取变压器有载调压数据
		//根据workid 获取
		getDataFromWorkId(workId){
			let config = mui.neioConfig.getNeioConfig();
			let url = config.URL.queryTransInfoByWorkId;
			let params = {};
			params.workId = workId;
			console.log("变压器："+JSON.stringify(params))
			mui.neiosRequst.httpRequst(url,params,function(ret){
				console.log(JSON.stringify(ret))
				if(ret.code == 0){
					console.log(ret)
					//列表赋值
					that.Record = ret;
		
					url = "../dailyRecord/transformer/procressing.html";
					
					let param = that.Record;
							
					param.position = 0;//当前选择的第几项
					param.mType = "1";  //0 录入|新增 1 展示/详情 2编辑修改 3办理
					param.isSearch = 1;
					let params = JSON.stringify(param);
					console.log("准备发射===>:"+JSON.stringify(params))
					let config = mui.neioConfig.getNeioConfig();
					let pageKey = config.KEYS.PAGE_PARAM_TRANSFORM_INFO;
					let paramStr = mui.neioConfig.setStorage(pageKey,params);
					
					mui.openWindow({
						url: url,
						id: url,
						extras: {},
						waiting: {
							autoShow: false
						}
					});
					console.log("KLKLK"+JSON.stringify(dataParam))
				}
				if( ret.code == 1){
						mui.toast(ret.msg)
				}
			},function(err){
				console.log("失败回掉："+JSON.stringify(err))
			})
		},
	}
});
// 显示操作按钮
function showOperBtn(el) {
	$('.todo').css('width', '0');
	$(el).next().css('width', '39vw');
}
// 待领操作按钮
function showAppointBtn(el) {
	$('.toAppoint').css('width', '0');
	$(el).next().css('width', '39vw');
}
$('.neios-station-btn').click(function() {
	let userInfo = JSON.parse(localStorage.getItem('neiosUser'))
	$('.neios-station-dialog-item').removeClass('on')
	let stationDom = $('.neios-station-dialog-item')
	for (let a = 0; a < userInfo.stationNewCodes.length; a++) {
		if (userInfo.stationNewCodes[a] == localStorage.getItem('neiosStationCode')) {
			$(stationDom[a]).addClass('on')
		}
	}
	$('.neios-station-dialog-box').show()
})
mui.init({
	pullRefresh: {
		container: "#terminalworkList", //待刷新区域标识，querySelector能定位的css选择器均可，比如：id、.class等
		down: { //下拉刷新
			style: 'circle',
			height: 50, //可选,默认50.触发下拉刷新拖动距离,
			auto: false, //可选,默认false.首次加载自动下拉刷新一次
			contentdown: "下拉可以刷新", //可选，在下拉可刷新状态时，下拉刷新控件上显示的标题内容
			contentover: "释放立即刷新", //可选，在释放可刷新状态时，下拉刷新控件上显示的标题内容
			contentrefresh: "正在刷新...", //可选，正在刷新状态时，下拉刷新控件上显示的标题内容
			callback: async function() { //必选，刷新函数，根据具体业务来编写，比如通过ajax从服务器获取新数据；
				terminalwork.currentPage = 1;
				terminalwork.queryTerminalList(1);
				////没有更多内容了，endPulldown 传入true， 不再执行下拉刷新
				mui('#terminalworkList').pullRefresh().endPulldownToRefresh();
				mui('#terminalworkList').pullRefresh().enablePullupToRefresh();
				mui('#terminalworkList').pullRefresh().endPullupToRefresh(true);
			}
		},
		up: { //上拉加载
			height: 50, //可选.默认50.触发上拉加载拖动距离
			auto: false, //可选,默认false.自动上拉加载一次
			contentrefresh: "正在加载...", //可选，正在加载状态时，上拉加载控件上显示的标题内容
			contentnomore: '没有更多数据了', //可选，请求完毕若没有更多数据时显示的提醒内容；
			callback: async function() { //必选，刷新函数，根据具体业务来编写，比如通过ajax从服务器获取新数据；
				terminalwork.currentPage = terminalwork.currentPage * 1 + 1;
				terminalwork.queryTerminalList(terminalwork.currentPage);
			}
		}
	},
});
mui.plusReady(function() {
	window.addEventListener('isRefresh', function() {
		window.location.reload()
	})
})
mui('.mui-input-clear')[0].addEventListener('focus', function() {
	mui(".mui-icon-clear")[0].addEventListener('tap', function() {
		terminalwork.terminalKeyword = ''
		terminalwork.queryTerminalList(1);
	})
})
